UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HKmk36pJbYqDqEUu6JO1wS/T9VaXIT294pyAxMPuDnM=' 
WHERE 
  key_id = '75ee3aec7ae08c5f8186e3dd0c5e30c9d90e9a5a7ea53912bfea01aa9edf2e84' 
  AND (
    token = 'HKmk36pJbYqDqEUu6JO1wS/T9VaXIT294pyAxMPuDnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039