UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YMZOU0MggBW/l/t6GHP6aoTvqmzRzOrP23e2z/As+aU=' 
WHERE 
  key_id = '48b0659dae509a61e258ca2bcc9c29c1c0f1a464ef76e989ff3b7898d6b75f63' 
  AND (
    token = 'YMZOU0MggBW/l/t6GHP6aoTvqmzRzOrP23e2z/As+aU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036