UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yJPYMDhR2xgx5Z6egv1cIU0Byp/LNouaRjWHy/OZMOg='
WHERE
key_id = '5c1f0cbeca5d8ad8e0db03c56dd9720e65445a304a4ccfafdc35fce85585abab'
AND (
token = 'yJPYMDhR2xgx5Z6egv1cIU0Byp/LNouaRjWHy/OZMOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)