UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RmTEhTctwiSm3Rut+f6yrruWa1KHvBiNxCCDKTjFRUw='
WHERE
key_id = 'ea6ac3bb05d97b638e2fa337382cc6911bd14fad734f96a14fcd5ae95f72b09b'
AND (
token = 'RmTEhTctwiSm3Rut+f6yrruWa1KHvBiNxCCDKTjFRUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)