UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fC8TgnCEVNYmvDVrQVDqjOq4FDS++P9L/ZUxt5TVpA0=' 
WHERE 
  key_id = '5a7dbe916a9eab9d176dd667a92c44c67f9eb44fb4df0317086711fcf721f7ae' 
  AND (
    token = 'fC8TgnCEVNYmvDVrQVDqjOq4FDS++P9L/ZUxt5TVpA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036