UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UqSoCx/UEZln6O4w5tgow8LU15bLSeljn/vZBWI+Q8U='
WHERE
key_id = '8ec0fbafca0f0d47c2a9fdc1dac2d79a31ebe60a85436449b3f69a74eb3fda2e'
AND (
token = 'UqSoCx/UEZln6O4w5tgow8LU15bLSeljn/vZBWI+Q8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)