UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8sw6GJ+3AEzpNk2DTKF4FoaMKd6qqNQZrjlUTH1k/CY='
WHERE
key_id = 'ba1efcdb81874910dd672569267c4967506dd2a6dd4d34ece1e58e223c5a0fa9'
AND (
token = '8sw6GJ+3AEzpNk2DTKF4FoaMKd6qqNQZrjlUTH1k/CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)