UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wbbflLg2bgnMunCql+TT4KeY69GQuMCPZnu2SeLBbhk=' 
WHERE 
  key_id = '964317a826e3178e91c9e0f1866b96d90a8e49d89b0c489c97eb510f4f8fbd5b' 
  AND (
    token = 'wbbflLg2bgnMunCql+TT4KeY69GQuMCPZnu2SeLBbhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017