UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'llGxqRT8rJbYAjxsYFm3ZFVbot/0ll7DrwyJfomLbAQ=' 
WHERE 
  key_id = 'ad4ad02a7a7d794ff4ae53706ea270022c4523e1fe3c4297fd4efb5f8472f5d6' 
  AND (
    token = 'llGxqRT8rJbYAjxsYFm3ZFVbot/0ll7DrwyJfomLbAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042