UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o3q5k5TbETzInD2OvBjnMujwpW2yo9nd1XCR5PH5ZDI=' 
WHERE 
  key_id = '4d3bafb19dbaa6e75f7c995a1a83d62edfdb9ef2a17b2d914fdc9c9c36a256e3' 
  AND (
    token = 'o3q5k5TbETzInD2OvBjnMujwpW2yo9nd1XCR5PH5ZDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045