UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mYr9156Fq7cnbnBW0Rm0dn6zhQ9if5xBv1Gs78mEYcw='
WHERE
key_id = '2c67e3d0379142b4162f7028cde25ea91b16783da2a906b5c266a3a1c246b854'
AND (
token = 'mYr9156Fq7cnbnBW0Rm0dn6zhQ9if5xBv1Gs78mEYcw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)