UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E0fiSxg3zpKW4y5Es1GvLrTe/Gowb/xUfspATqJGoSs='
WHERE
key_id = '3a20bbe1b1a7c6d2491d4f2788cbf9dc2f775ab9682bc943ea7afd36b1be51b3'
AND (
token = 'E0fiSxg3zpKW4y5Es1GvLrTe/Gowb/xUfspATqJGoSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)