UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oq6RGVnTCCrSFLDYVYSc+OLPKHw+KjXundajjx3Hohw=' 
WHERE 
  key_id = '6a6686304337fb15e7d939c969165cb0fa09deb99128d940b493fe89b332e723' 
  AND (
    token = 'oq6RGVnTCCrSFLDYVYSc+OLPKHw+KjXundajjx3Hohw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048