UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jECAHHA8br9dlPk0HqsnkXLkKhGP2R4GRckxaLCOMkU='
WHERE
key_id = 'f75702658bfd2f8d392b2b262e4fd177e31046d845667178db1f79592e6ffb52'
AND (
token = 'jECAHHA8br9dlPk0HqsnkXLkKhGP2R4GRckxaLCOMkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)