UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i7LOTt8hhbcNq3ajaF8mRenH5rUoofrEtAwTUnUtbDU='
WHERE
key_id = 'dc36b97ced2a0a6ccc1c9937b4529ac59b1f1090a270849b6d2f03fb2947f016'
AND (
token = 'i7LOTt8hhbcNq3ajaF8mRenH5rUoofrEtAwTUnUtbDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)