UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NofVVFfiEkjyKwqI39ujTFkpyxOpbeL9sP0DYIau2eM=' 
WHERE 
  key_id = 'b130decaf18f1be496db7bc2098fa422d674fe16186a9d78d31f4372111d31f0' 
  AND (
    token = 'NofVVFfiEkjyKwqI39ujTFkpyxOpbeL9sP0DYIau2eM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021