UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IXqgcASLoUAIC95No1/CxRrZGHgalZoiXuVXR/FEk5s=' 
WHERE 
  key_id = 'c546973c1990f439268ee88ab9cb5d752ab31b89e3c30ac569da8a4d20bfc273' 
  AND (
    token = 'IXqgcASLoUAIC95No1/CxRrZGHgalZoiXuVXR/FEk5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018