UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm6DHMhMOUTZkQUXKZtcpaDotxF2Q4KMNPpXAcQnKEiI='
WHERE
key_id = '64c79bc5440ff02ffcb4f6ee4ebf5bc2f2dcf42c948dc391a757a430f718ce4f'
AND (
token = 'm6DHMhMOUTZkQUXKZtcpaDotxF2Q4KMNPpXAcQnKEiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)