UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mzh4ZmZ4aA3spyJymWIFQCtFkWWarpkiju6cRb05uyw='
WHERE
key_id = '28b0993a78eedb6ffb95f51d242b5e207d616a01fcefb518d0a3c95006c01e0f'
AND (
token = 'mzh4ZmZ4aA3spyJymWIFQCtFkWWarpkiju6cRb05uyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)