UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LqMgybjQE/HRUy+cV9/Xc6vFjWiaHphNdqocVnDVx6M='
WHERE
key_id = '0d8546066397d09744a27b111f3123c3bb8c9c6dc712e5d89e5c5bde26d51730'
AND (
token = 'LqMgybjQE/HRUy+cV9/Xc6vFjWiaHphNdqocVnDVx6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)