UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '667Qq+QeCwiPfz1rmiygFsFngT4AjWY6OTzJeYiBXXY=' 
WHERE 
  key_id = 'b29129d35dca3ef6859b2aa5a0a73e0569f6c80ae43280f2877a9e1428ce0584' 
  AND (
    token = '667Qq+QeCwiPfz1rmiygFsFngT4AjWY6OTzJeYiBXXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040