UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gj6oJB0Vnt0oM5RgJEwO5WfCtaPEwrmFFfo89DyqzNs=' 
WHERE 
  key_id = '715e9ce858e5bcbd15b3c7954c15fb0bba9404f20201e4682b7bb80dea6e26a7' 
  AND (
    token = 'gj6oJB0Vnt0oM5RgJEwO5WfCtaPEwrmFFfo89DyqzNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028