UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nKU+1FhelrapoSKjZOMHJOHxX9LW1nuOlF/d3Oev+jU=' 
WHERE 
  key_id = '5369ab6c529026f1ea8b5f3342216cc563ea1547993c6012c2397604b4a39da2' 
  AND (
    token = 'nKU+1FhelrapoSKjZOMHJOHxX9LW1nuOlF/d3Oev+jU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043