UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wwn2owwJIlR5nG57oTUQSWWPLEcEggLuETwHHtsa4Rk=' 
WHERE 
  key_id = 'f1dc2c11e7ea67962ab96f91c0dd777d0dc41f574bbd859a8cb084a4bae7e041' 
  AND (
    token = 'Wwn2owwJIlR5nG57oTUQSWWPLEcEggLuETwHHtsa4Rk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018