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

Query time 0.00034