UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mDvrJP82uXsi5GBdZn5ujyUfh3Ms0+zKNTX2kGL+CDU=' 
WHERE 
  key_id = '6c1ae6cadd172b7842f2055c34480f70100ba1a2d1e9a977d3ba3649d099b5fe' 
  AND (
    token = 'mDvrJP82uXsi5GBdZn5ujyUfh3Ms0+zKNTX2kGL+CDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042