UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IcN71Qum/d289tQlXwxmAxdYO3L/5lDVRhT5Jpce1NI=' 
WHERE 
  key_id = '2b67987db8dafea3679a7bd81cc076f94aba1804a8b8c267e14c931a5eb08551' 
  AND (
    token = 'IcN71Qum/d289tQlXwxmAxdYO3L/5lDVRhT5Jpce1NI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026