UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'icqxkOrb8cQ3W9znFzQSUjic545vE0f9wfo1KSZHHng=' 
WHERE 
  key_id = '21cf36523cfbaba56442645e760a62ce6d735e95448dd6fdb4076c398c515428' 
  AND (
    token = 'icqxkOrb8cQ3W9znFzQSUjic545vE0f9wfo1KSZHHng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027