UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MjN6vPBBGfG6iIMexH8WX8FnP8mOQMrPy0WLqv/DzXI=' 
WHERE 
  key_id = '7231562d268bbc682a06bda4b8707e1cbb93c7d3dcb9a8197ad47006390b7185' 
  AND (
    token = 'MjN6vPBBGfG6iIMexH8WX8FnP8mOQMrPy0WLqv/DzXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017