UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '368bLAWFHPAp0hInFFsTPrlxbPB9nSj7fsRiJ3OT31g='
WHERE
key_id = '818995c9c5c5bf1dd8fb085c552410db54aa05d660b8c7f7fc08ff8f19f20e49'
AND (
token = '368bLAWFHPAp0hInFFsTPrlxbPB9nSj7fsRiJ3OT31g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)