UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tmr6imm6+Z6JBYXF5W/wm9+P1HHcWOe/vevrDL2sZvA='
WHERE
key_id = '127248ad74115ac44eec1b708aff47d52b753e1b9153d1afa5191f351e944045'
AND (
token = 'tmr6imm6+Z6JBYXF5W/wm9+P1HHcWOe/vevrDL2sZvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)