UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R88eT985IUNRd8XxkOK+4aoo9pYN0OT1JDUh4YXKNI4='
WHERE
key_id = 'b3fd342f4e41059055f2b71242ac55998ad2e642f2fbbe9e4d22f2644ebbcd32'
AND (
token = 'R88eT985IUNRd8XxkOK+4aoo9pYN0OT1JDUh4YXKNI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)