UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBsi4qCyJ30lhlfBmC4aNP3bk/mIGf4GhvRpxmntNWI='
WHERE
key_id = 'f15eaabd48f89eb4bde6266d0a542c410edbf7e08c82ae48e1050a2517ed80c5'
AND (
token = 'WBsi4qCyJ30lhlfBmC4aNP3bk/mIGf4GhvRpxmntNWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)