UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33ZOrHg6Ar1WWr1w2IxCzt2gHP7BOK8xQbifsfjDhQ8='
WHERE
key_id = '4aa23c0442a40944661e61ce2019b810e4a279e957cd8e07fdb14c77b5963901'
AND (
token = '33ZOrHg6Ar1WWr1w2IxCzt2gHP7BOK8xQbifsfjDhQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)