UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cqMG5mvCFU1OrQ8rqQDNm7GPi/EMWvoYR5M4dqvTMUA=' 
WHERE 
  key_id = '3c887778c62bc0c4aa50d03b148432f487d4d482f643e21bc0a7ddb9230051fb' 
  AND (
    token = 'cqMG5mvCFU1OrQ8rqQDNm7GPi/EMWvoYR5M4dqvTMUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031