UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sMMK+9TbW4NvKvdr5hXcjxwm26iLcapHSHa9K7sp7/Y=' 
WHERE 
  key_id = '5621c85b83eb134c84e79b8cc06e0b920595b5bbab385ab522b12cd5b9b30ff3' 
  AND (
    token = 'sMMK+9TbW4NvKvdr5hXcjxwm26iLcapHSHa9K7sp7/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035