UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xhoS3P1ivSAL2fkBgwRyiU35OjfFqFThSLkip6Ee4yQ='
WHERE
key_id = '305bf7d5eb4cfed12b1394b9d3c63e9e2182f595fcd352a5d059a6ebf0f64d98'
AND (
token = 'xhoS3P1ivSAL2fkBgwRyiU35OjfFqFThSLkip6Ee4yQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)