UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h/5WLPILqk1drg4bAJgXQioK7LvNsaknu8Bvvjqbhns=' 
WHERE 
  key_id = '30b0ecd26756a1a2f29f2f34521dc90f7fcce1fe8b537ad592275ebce91e99b3' 
  AND (
    token = 'h/5WLPILqk1drg4bAJgXQioK7LvNsaknu8Bvvjqbhns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033