UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r7ox8MXNRFDzicKHu31NxY+zGJXZoEXGXMzWeYnk5gQ=' 
WHERE 
  key_id = '96756c79d0142aa39c68bcea489f9368da943efe1101276b6fe48481600fff52' 
  AND (
    token = 'r7ox8MXNRFDzicKHu31NxY+zGJXZoEXGXMzWeYnk5gQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027