UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7yQYm0wzqIx6McaOjhTyIwTQePg+gEdnKCOoV1AeZWs='
WHERE
key_id = '0bbbd430b909cb6509a805e1a8c1699590bdaf4f025895b4630db83f8b0bef3f'
AND (
token = '7yQYm0wzqIx6McaOjhTyIwTQePg+gEdnKCOoV1AeZWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)